using System;
using System.Collections.Generic;
using System.Text;

namespace WCFServer.ServiceImplementation
{
    public static class TranslateBetweenCardAndCard
    {
        public static WCFServer.BusinessLogic.Card TranslateCardToCard(WCFServer.DataContracts.Card from)
        {
            WCFServer.BusinessLogic.Card to = new WCFServer.BusinessLogic.Card();
            to.kolor = (BusinessLogic.Card.color)Enum.Parse(typeof(BusinessLogic.Card.color), from.kolor.ToString());
            to.wartosc = (BusinessLogic.Card.CardFace)Enum.Parse(typeof(BusinessLogic.Card.CardFace), from.wartosc.ToString());
            return to;
        }

        public static WCFServer.DataContracts.Card TranslateCardToCard(WCFServer.BusinessLogic.Card from)
        {
            WCFServer.DataContracts.Card to = new WCFServer.DataContracts.Card();
            to.kolor = (DataContracts.Card.color)Enum.Parse(typeof(DataContracts.Card.color), from.kolor.ToString());
            to.wartosc = (DataContracts.Card.CardFace)Enum.Parse(typeof(DataContracts.Card.CardFace), from.wartosc.ToString());
            return to;
        }
    }
}

